import {Component, Input} from '@angular/core';

import * as moment from 'moment';

@Component({
    selector: 'adp-policy-item',
    templateUrl: 'adp-policy-item.html'
})
export class AdpPolicyItemComponent {

    /** [data]='policyItem'
     *  policyItem: any = {
            policyID: 4300020230,
            mainRisk: '主险名称',
            policyHolder: '投保人',
            sexPolicyHolder: 'F',
            agePolicyHolder:40,
            recognizee: '被保险人',
            sexRecognizee:'M',
            ageRecognizee:50,
            payment: 1521685973,
            policyValueDate: 1521685973,
            policyStatus: '状态',
        };
     */
    @Input() data: any;

    moment = moment;

    constructor() {
    }

    getSex(sex: string): string {
        if (sex === 'F') return 'nan';
        if (sex === 'M') return 'nv';
        if (sex === '') return 'unknow';
    }

}
